<?php
// Language File (modinfo.php)
$langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
if( ! file_exists( $langmanpath ) ) die( 'install the latest altsys' ) ;
require_once( $langmanpath ) ;
$langman =& D3LanguageManager::getInstance() ;
$langman->read( 'modinfo.php' , $mydirname , $mytrustdirname , false ) ;

include dirname(__FILE__) . '/include/version.php';

$constpref = '_MI_' . $mydirname;

//-----------------------------------------------------------------------
$modversion['name']        = constant($constpref ."_NAME");
$modversion['version']     = floatval(_LINKS_VERSION);
$modversion['description'] = constant($constpref ."_DESC");
$modversion['credits']     = "wye , http://never-ever.info/";
$modversion['help']        = "";
$modversion['license']     = "GPL see LICENSE";
$modversion['official']    = 0 ;
$modversion['image']       = "module_icon.php";
$modversion['dirname']     = $mydirname;

// Database Tables
$modversion['sqlfile'] = false ;
$modversion['tables']  = array() ;

// Admin things
$modversion['hasAdmin']   = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu']  = "admin/menu.php";

// Blocks
$modversion['blocks'][1]['file']        = 'blocks.php';
$modversion['blocks'][1]['name']        = constant($constpref . '_BNAME1');
$modversion['blocks'][1]['description'] = '';
$modversion['blocks'][1]['show_func']   = 'b_links_top_show';
$modversion['blocks'][1]['edit_func']   = 'b_links_top_edit';
$modversion['blocks'][1]['options']     = "$mydirname|0|10|20|0|0|1|0|0||";//dir,order,num,len,shot,table,cols,mobile,adult,categ,tpl
$modversion['blocks'][1]['template']    = "";
$modversion['blocks'][1]['can_clone']   = TRUE;
$modversion['blocks'][1]['func_num']    = 1;

$modversion['blocks'][2]['file']        = 'blocks.php';
$modversion['blocks'][2]['name']        = constant($constpref . '_BNAME2');
$modversion['blocks'][2]['description'] = '';
$modversion['blocks'][2]['show_func']   = 'b_links_easypost_show';
$modversion['blocks'][2]['edit_func']   = 'b_links_easypost_edit';
$modversion['blocks'][2]['options']     = "$mydirname|||";//dir,cid,tpl
$modversion['blocks'][2]['template']    = '';
$modversion['blocks'][2]['can_clone']   = TRUE;
$modversion['blocks'][2]['func_num']    = 2;

$modversion['blocks'][3]['file']        = 'blocks.php';
$modversion['blocks'][3]['name']        = constant($constpref . '_BNAME3');
$modversion['blocks'][3]['description'] = '';
$modversion['blocks'][3]['show_func']   = 'b_links_category_show';
$modversion['blocks'][3]['edit_func']   = 'b_links_category_edit';
$modversion['blocks'][3]['options']     = "$mydirname||";//dir,cid,tpl
$modversion['blocks'][3]['template']    = '';
$modversion['blocks'][3]['can_clone']   = TRUE;
$modversion['blocks'][3]['func_num']    = 3;

$modversion['blocks'][4]['file']        = 'blocks.php';
$modversion['blocks'][4]['name']        = constant($constpref . '_BNAME4');
$modversion['blocks'][4]['description'] = '';
$modversion['blocks'][4]['show_func']   = 'b_links_approval_show';
$modversion['blocks'][4]['edit_func']   = 'b_links_approval_edit';
$modversion['blocks'][4]['options']     = "$mydirname||";//dir,tpl
$modversion['blocks'][4]['template']    = '';
$modversion['blocks'][4]['can_clone']   = TRUE;
$modversion['blocks'][4]['func_num']    = 4;


// Menu
$modversion['hasMain'] = 1;

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = $mydirname."_search";

// Templates
$modversion['templates'] = array() ;

// Configs
$num = 1 ;
$modversion['config'][$num] = array(
	'name'        => 'url_approach',
	'title'       => $constpref .'_URL_APPROCH',
	'description' => $constpref .'_URL_APPROCH_DSC',
	'formtype'    => 'select',
	'valuetype'   => 'int',
	'default'     => '0' ,
	'options'     => array(	$constpref.'_URL_APPROCH_0' => '0', 
							$constpref.'_URL_APPROCH_1' => '1', 
							$constpref.'_URL_APPROCH_2' => '2', 
							$constpref.'_URL_APPROCH_3' => '3', ),
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'url_suffix',
	'title'       => $constpref .'_URL_SUFFIX',
	'description' => $constpref .'_URL_SUFFIX_DSC',
	'formtype'    => 'textbox',
	'valuetype'   => 'text',
	'default'     => '.html',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'category_selector',
	'title'       => $constpref .'_CAT_SELECTOR',
	'description' => $constpref .'_CAT_SELECTOR_DSC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '0',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'popular',
	'title'       => $constpref .'_POPULAR',
	'description' => $constpref .'_POPULARDSC',
	'formtype'    => 'select',
	'valuetype'   => 'int',
	'default'     => '100',
	'options'     => array('5' => 5, '10' => 10, '50' => 50, '100' => 100, '200' => 200, '500' => 500, '1000' => 1000),
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'perpage',
	'title'       => $constpref .'_PERPAGE',
	'description' => $constpref .'_PERPAGEDSC',
	'formtype'    => 'textbox',
	'valuetype'   => 'int',
	'default'     => '10',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'mobile_perpage',
	'title'       => $constpref .'_MOBILE_PERPAGE',
	'description' => $constpref .'_MOBILE_PERPAGEDSC',
	'formtype'    => 'textbox',
	'valuetype'   => 'int',
	'default'     => '3',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'frame',
	'title'       => $constpref .'_USEFRAMES',
	'description' => $constpref .'_USEFRAMEDSC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '0',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'screenshot',
	'title'       => $constpref .'_SCREENSHOT',
	'description' => $constpref .'_SCREENSHOTDSC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '0',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'screenshot_cache_time',
	'title'       => $constpref .'_SCREENSHOT_CACHE',
	'description' => $constpref .'_SCREENSHOT_CACHE_DSC',
	'formtype'    => 'textbox',
	'valuetype'   => 'int',
	'default'     => '30',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'categoryicon_path',
	'title'       => $constpref .'_CATICON_PATH',
	'description' => $constpref .'_CATICON_PATHDESC',
	'formtype'    => 'textbox',
	'valuetype'   => 'text',
	'default'     => "modules/$mydirname/images/categories",
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'request_perm',
	'title'       => $constpref .'_REQUEST',
	'description' => $constpref .'_REQUEST_DESC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '0',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'rating_type',
	'title'       => $constpref . '_RATING_TYPE',
	'description' => $constpref . '_RATING_TYPE_DESC',
	'formtype'    => 'select',
	'valuetype'   => 'int',
	'default'     => '2',
	'options'     => array($constpref.'_RATING_TYPE_1'=>1, $constpref.'_RATING_TYPE_2'=>2),
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'display_type',
	'title'       => $constpref .'_DISP_TYPE',
	'description' => $constpref .'_DISP_TYPE_DESC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '0',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'table_cols',
	'title'       => $constpref .'_TABLE_COLS',
	'description' => $constpref .'_TABLE_COLS_DESC',
	'formtype'    => 'select',
	'valuetype'   => 'int',
	'default'     => '3',
	'options'     => array('1'=>1, '2'=>2, '3'=>3, '4'=>4, '5'=>5, '6' >6, '7'=>7, '8'=>8, '9'=>9, '10'=>10),
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'redirect_type',
	'title'       => $constpref .'_REDIRECT_TYPE',
	'description' => $constpref .'_REDIRECT_TYPE_DESC',
	'formtype'    => 'yesno',
	'valuetype'   => 'int',
	'default'     => '1',
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'comment_dirname' ,
	'title'       => $constpref.'_COM_DIRNAME' ,
	'description' => '' ,
	'formtype'    => 'textbox' ,
	'valuetype'   => 'text' ,
	'default'     => '' ,
	'options'     => array()
) ;
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'comment_forum_id' ,
	'title'       => $constpref.'_COM_FORUM_ID' ,
	'description' => '' ,
	'formtype'    => 'textbox' ,
	'valuetype'   => 'int' ,
	'default'     => '0' ,
	'options'     => array()
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'comment_order' ,
	'title'       => $constpref.'_COM_ORDER' ,
	'description' => '' ,
	'formtype'    => 'select' ,
	'valuetype'   => 'text' ,
	'default'     => 'desc' ,
	'options'     => array( '_OLDESTFIRST' => 'asc' , '_NEWESTFIRST' => 'desc' )
) ;
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'comment_view' ,
	'title'       => $constpref.'_COM_VIEW' ,
	'description' => '' ,
	'formtype'    => 'select' ,
	'valuetype'   => 'text' ,
	'default'     => 'listposts_flat' ,
	'options'     => array( '_FLAT' => 'listposts_flat' , '_THREADED' => 'listtopics' )
);
$num++ ;
$modversion['config'][$num] = array(
	'name'        => 'comment_posts_num' ,
	'title'       => $constpref.'_COM_POSTSNUM' ,
	'description' => '' ,
	'formtype'    => 'textbox' ,
	'valuetype'   => 'int' ,
	'default'     => '10' ,
	'options'     => array()
) ;



// onInstall, onUpdata, onUninstall
$modversion['onInstall']   = 'include/oninstall.php';
$modversion['onUpdate']    = 'include/onupdate.php';
$modversion['onUninstall'] = 'include/onuninstall.php';

// keep block's options
if (! defined( 'XOOPS_CUBE_LEGACY' ) && substr(XOOPS_VERSION, 6, 3) < 2.1 && ! empty($_POST['fct']) && ! empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok' && $_POST['dirname'] == $modversion['dirname']) {
	include dirname(__FILE__) . '/include/updateblock.inc.php' ;
}

